/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author tien
 */
import java.io.IOException;
import java.util.Timer;
import java.util.TimerTask;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.game.GameCanvas;
import javax.microedition.lcdui.game.LayerManager;
import javax.microedition.lcdui.game.Sprite;
import javax.microedition.lcdui.game.TiledLayer;

public class Spider extends Moveable{
    
    public Spider(GameScreen canvas, Sprite sprite, SpriteAnimationTask animator) throws IOException {
        super(canvas, sprite, animator);
    }
    
    public void update() {
        this.controller.update();
    }
    
    public boolean checkCollideAndSolve() {
        //Map
        boolean mapCollide =  canvas.getMap().checkCollide(sprite);
                
        //Boy
        boolean boyCollide = canvas.boyCollideWithSpider(this);
        
        //others spiders
        boolean otherSpidersCollide = canvas.spidersCollideWithSpider(this);
        
        return !(mapCollide || boyCollide || otherSpidersCollide);
    }

    void die() {
        super.die();
    }
}
